﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_StaffLogin : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        BLLStaffLogin bllStaffLogin = new BLLStaffLogin();
        tblStaff staff = bllStaffLogin.login(txtName.Text.Trim(), txtPassword.Text.Trim());
        if (staff != null)
        {
            LoginedStaff = staff;
            if(LoginedStaff.RoleID == 3) {
            Response.Redirect("Index.aspx");
            }
            else if (LoginedStaff.RoleID == 1) {
                Response.Redirect("~/Admin/Management.aspx");
            }
        }
        else
        {
            lblError.Visible = true;
        }
    }
}